<script type="application/javascript">
	function changeCurr(id,price)
	{
		
		usd = document.getElementById(id+"usd");
		sjc = document.getElementById(id+"sjc");
		vnd = document.getElementById(id+"vnd");
		
		usdid = document.getElementById("usd"+id);
		sjcid = document.getElementById("sjc"+id);
		vndid = document.getElementById("vnd"+id);
		
		if(price == "usd")
		{
			usd.style.display = "block";
			sjc.style.display = "none";
			vnd.style.display = "none";
			
			usdid.className = "USD active_rate";
			sjcid.className = "USD";
			vndid.className = "USD";
		}
		else if(price == "sjc")
		{
			usd.style.display = "none";
			sjc.style.display = "block";
			vnd.style.display = "none";
			usdid.className = "USD";
			sjcid.className = "USD active_rate";
			vndid.className = "USD";
		}
		else if (price == "vnd")
		{
			usd.style.display = "none";
			sjc.style.display = "none";
			vnd.style.display = "block";
			usdid.className = "USD";
			sjcid.className = "USD";
			vndid.className = "USD active_rate";
		}
	}
</script>
<?php 
	$row = $result;
	$row2 = $result2;
//	print_r($row);
if(!empty($row) )
{
?>
	<div class="left_title_cuv"></div>
        <div class="mid_title_cuv"><?php if(empty($_SESSION['lang'])) echo "Tower detail";else echo "Chi tiết căn hộ"?></div>
        <div class="right_title_cuv"></div>
      <div class="content">
				<p class="info"><?php if(empty($_SESSION['lang'])) echo $row['news_name_en'];else echo $row['news_name']?></p>        
                <img src="<?php echo base_url()?>upload/news/<?php echo $row['news_image']?>" width="520" height="375" align="left"/><br />
               <table width="200" border="1" class="price_info" bordercolor="#DDD">
                    <tr>
                      <td width="25%" height="24"><?php echo "Code" ?></td>
                      <td width="75%"  height="24" class="msg_code"><?php echo $row['news_code']?></td>
                    </tr>
                    <tr>
                      <td colspan="2">
            		<a href="javascript:changeCurr(<?php echo $row['news_id']?>,'usd');" id="usd<?php echo $row['news_id']?>" class="USD active_rate" style="margin-left:30px;">USD</a>
                	<a href="javascript:changeCurr(<?php echo $row['news_id']?>,'sjc');" id="sjc<?php echo $row['news_id']?>" class="USD">SJC</a>
                    <a href="javascript:changeCurr(<?php echo $row['news_id']?>,'vnd');" id="vnd<?php echo $row['news_id']?>" class="USD">VND</a>
                  
                  
                  
                      </td>
                    </tr>
                    <tr>
                    	<td colspan="2" align="center"> 
                      <span id="<?php echo $row['news_id']?>usd"><?php echo $row['news_price_usd'] ?> usd</span>
                    <span id="<?php echo $row['news_id']?>sjc"style="display:none" ><?php echo $row['news_price_sjc'] ?> sjc</span>
                    <span id="<?php echo $row['news_id']?>vnd"style="display:none" ><?php echo number_format($row['news_price_vnd'])?> vnd</span>
                        </td>
                    </tr>
			  </table>
              <div class="gallery">
              		
              </div><!--end gallery-->
        <div class="interview_info">
       	  <span style="color:#F00; font-weight:bold; text-decoration:underline"><?php if(empty($_SESSION['lang'])) echo "Detail";else echo "Mô tả chi tiết"?></span><br />
              <?php if(empty($_SESSION['lang'])) echo html_entity_decode($row['news_detail_en'],ENT_QUOTES,"UTF-8");else echo html_entity_decode($row['news_detail'],ENT_QUOTES,"UTF-8")?>
           </div><!--end interview_info-->
        </div><!--end content-->
        <div class="left_title_cuv"></div>
        <div class="mid_title_cuv"><?php if(empty($_SESSION['lang'])) echo $result3['cat_name_en']; else echo $result3['cat_name']?></div>
        <div class="right_title_cuv"></div>
        <div class="content">
        	<?php if(!empty($row2)){foreach($row2 as $item){ if($item['news_id'] != $row['news_id']){?>
        	<div class="outer_pro" style="margin-left:0px;">
            	<a href="<?php echo base_url()?>index.php/news/detail/<?php echo $item['news_id']?>/<?php echo $item['cat_id']?>"><img src="<?php echo base_url()?>upload/news/<?php echo $item['news_image']?>" class="img_pro"/></a>
            
					<a href="javascript:changeCurr(<?php echo $item['news_id']?>,'usd');" id="usd<?php echo $item['news_id']?>" class="USD active_rate" style="margin-left:30px;">USD</a>
                	<a href="javascript:changeCurr(<?php echo $item['news_id']?>,'sjc');" id="sjc<?php echo $item['news_id']?>" class="USD">SJC</a>
                    <a href="javascript:changeCurr(<?php echo $item['news_id']?>,'vnd');" id="vnd<?php echo $item['news_id']?>" class="USD">VND</a> 
                   
                    <span id="<?php echo $item['news_id']?>usd"><?php echo $item['news_price_usd'] ?> usd</span>
                    <span id="<?php echo $item['news_id']?>sjc"style="display:none" ><?php echo $item['news_price_sjc'] ?> sjc</span>
                    <span id="<?php echo $item['news_id']?>vnd"style="display:none" ><?php echo number_format($item['news_price_vnd'])?> vnd</span>
                    <a href="<?php echo base_url()?>index.php/news/detail/<?php echo $item['news_id']?>/<?php echo $item['cat_id']?>" class="pro_info"><?php if(empty($_SESSION['lang'])) echo $item['news_short_en'];else echo $item['news_short'] ?></a>
            </div><!--end outer_pro-->
            <?php }}}?>
        </div><!--end content-->
<?php
}
else
{
	echo "Dữ liệu hiện đang cập nhật";	
}
?>